import cn.wellwan.strategypattern.Duck;
import cn.wellwan.strategypattern.FlyRocketPowered;
import cn.wellwan.strategypattern.ModeDuck;

/**
 * 测试
 */
public class Main {

    public static void main(String[] args) {
        //静态鸭
//        Duck mallardDuck = new MallardDuck();
//        mallardDuck.performFly();
//        mallardDuck.performQuack();

        //动态设定行为
        Duck modelDuck = new ModeDuck();
        modelDuck.setFlyBehavior(new FlyRocketPowered());
        modelDuck.performFly();
        modelDuck.performQuack();
    }
}
